package cn.cs.client;

import cn.cs.common.Page;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.CsMenuFallBack;
import cn.cs.fallback.CsOrgFallBack;
import cn.cs.pojo.CsMenu;
import cn.cs.pojo.CsOrg;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = CsMenuFallBack.class)
public interface CsMenuClient {


    @RequestMapping(value = "/getCsMenuByRoleName", method = RequestMethod.POST)
    public List<CsMenu> getCsMenuByRoleName(@RequestParam("roleName") String roleName);

    @RequestMapping(value = "/getCsMenuById", method = RequestMethod.POST)
    public CsMenu getCsMenuById(@RequestParam("id") Long id) throws Exception;

    @RequestMapping(value = "/getCsMenuListByMap", method = RequestMethod.POST)
    public List<CsMenu> getCsMenuListByMap(@RequestBody Map<String, Object> param);

    @RequestMapping(value = "/getAllMenu", method = RequestMethod.POST)
    public List<CsMenu> getAllMenu();

    @RequestMapping(value = "/getMenuTree", method = RequestMethod.POST)
    public List<CsMenu> getMenuTree(@RequestBody List<String> authoritiesList, @RequestBody List<String> ids);

    @RequestMapping(value = "/getMenuList", method = RequestMethod.POST)
    public List<CsMenu> getMenuList(@RequestParam("pId") String pId, @RequestBody List<String> authoritiesList, @RequestBody List<String> ids);

    @RequestMapping(value = "/getMenuByRoleId", method = RequestMethod.POST)
    public List<CsMenu> getMenuByRoleId(@RequestParam("id") String id);

    @RequestMapping(value = "/getCsMenuCountByMap", method = RequestMethod.POST)
    public Integer getCsMenuCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addCsMenu", method = RequestMethod.POST)
    public Integer addCsMenu(@RequestBody CsMenu csMenu) throws Exception;

    @RequestMapping(value = "/modifyCsMenu", method = RequestMethod.POST)
    public Integer modifyCsMenu(@RequestBody CsMenu csMenu) throws Exception;

    @RequestMapping(value = "/deleteCsMenuById", method = RequestMethod.POST)
    public Integer deleteCsMenuById(@RequestParam("id") Long id) throws Exception;

    @RequestMapping(value = "/getMenuListAll", method = RequestMethod.POST)
    public List<CsMenu> getMenuListAll(@RequestBody List<String> authoritiesList, @RequestBody List<String> ids);


}

